package com.cloudserver.springboot.dao;

import com.cloudserver.springboot.bean.Character;
import com.cloudserver.springboot.bean.CharacterExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface CharacterMapper {
    long countByExample(CharacterExample example);

    int deleteByExample(CharacterExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Character record);

    int insertSelective(Character record);

    List<Character> selectByExample(CharacterExample example);

    Character selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Character record, @Param("example") CharacterExample example);

    int updateByExample(@Param("record") Character record, @Param("example") CharacterExample example);

    int updateByPrimaryKeySelective(Character record);

    int updateByPrimaryKey(Character record);

    @Select("SELECT * from `character` WHERE id = (SELECT character_id FROM user_character WHERE user_id = #userId)")
    List<Character> getAllById(Integer userId);

}